package com.wkck.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wkck.VO.NewsInfoVO;
import com.wkck.VO.PageResult;
import com.wkck.VO.UploadContentVo;
import com.wkck.domain.News;
import com.wkck.domain.NewsContent;
import com.wkck.dto.NewsQueryBackendDto;
import com.wkck.dto.NewsQueryFrontendDto;
import com.wkck.dto.SaveNewsInfoDto;

import java.util.List;

public interface NewsService extends IService<News> {

    /***
     * @Author: CK
     * @Date: 2024/3/21
     * @Param: [dto]
     * @Description: 得到新闻列表数据
     */
    PageResult getNewsInfo(NewsQueryBackendDto dto);

    /***
     * @Author: CK
     * @Date: 2024/3/21
     * @Param: [dto]
     * @Description: 得到新闻列表数据
     */
    Page<News> getFrontendNewsInfo(NewsQueryFrontendDto dto);

    /***
     * @Author: CK
     * @Date: 2024/3/21
     * @Param: []
     * @Description: 创建新闻数据记录
     */
    String createNewsInfo();

    /***
     * @Author: CK
     * @Date: 2024/3/21
     * @Param: [id]
     * @Description: 根据新闻id得到新闻信息
     */
    NewsInfoVO getNewsInfoById(Long id);

    /***
     * @Author: CK
     * @Date: 2024/3/22
     * @Param: [file, id]
     * @Description: 新闻添加封面图
     */
    String insertNewsTitlePhotoById(String localFilePath, long size, String filename, Long id);

    /**
     * @Author: CK
     * @Date: 2024/3/22
     * @Param: [id]
     * @Description: 删除新闻
     */
    Boolean removeNewsById(List<String> ids);

    /***
     * @Author: CK
     * @Date: 2024/3/22
     * @Param: [file, id]
     * @Description: 上传正文中图片
     */
    UploadContentVo uploadContentPhoto(String localFilePath, long size, String filename, Long id);

    /***
     * @Author: CK
     * @Date: 2024/3/23
     * @Param: [dto]
     * @Description: 保存新闻信息
     */
    Boolean saveNewsInfo(SaveNewsInfoDto dto);

    /****
     * @Author: CK
     * @Date: 2024/3/23
     * @Param: [news]
     * @Description: 修改新闻状态
     */
    Boolean changeState(News news);

    /***
     * @Author: CK
     * @Date: 2024/3/23
     * @Param: [id]
     * @Description: 预览新闻
     */
    NewsContent getPreviewNewsContent(Long id);
}
